package no.ntnu.fp.gui;

import java.awt.Color;
import java.awt.Component;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import javax.swing.JButton;
import javax.swing.JButton;
import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;

public class customTableCellRenderer extends JButton implements TableCellRenderer {
	
	
	@Override
	public Component getTableCellRendererComponent(JTable table, Object value,
			boolean isSelected, boolean hasFocus, int row, int column) {

		JButton returnLabel = new JButton();
		
		
		if(isSelected){
			//returnLabel.setForeground(Color.CYAN);
			returnLabel.setSelected(true);
			returnLabel.doClick();
		}
		
		if(value==null){
			returnLabel.setText("En avtale");
			returnLabel.setToolTipText("Her er det tooltip");
			}
		else {
			returnLabel.setText(value.toString());
			
		}
		return returnLabel;
	}


}
